package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementBusiElineNnipw2Mapper;
import com.ruoyi.net.domain.ElementBusiElineNnipw2;
import com.ruoyi.net.service.IElementBusiElineNnipw2Service;

/**
 * 网元-业务-eline-nni-pw高级属性Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementBusiElineNnipw2ServiceImpl implements IElementBusiElineNnipw2Service 
{
    @Autowired
    private ElementBusiElineNnipw2Mapper elementBusiElineNnipw2Mapper;

    /**
     * 查询网元-业务-eline-nni-pw高级属性
     * 
     * @param id 网元-业务-eline-nni-pw高级属性主键
     * @return 网元-业务-eline-nni-pw高级属性
     */
    @Override
    public ElementBusiElineNnipw2 selectElementBusiElineNnipw2ById(String id)
    {
        return elementBusiElineNnipw2Mapper.selectElementBusiElineNnipw2ById(id);
    }

    /**
     * 查询网元-业务-eline-nni-pw高级属性列表
     * 
     * @param elementBusiElineNnipw2 网元-业务-eline-nni-pw高级属性
     * @return 网元-业务-eline-nni-pw高级属性
     */
    @Override
    public List<ElementBusiElineNnipw2> selectElementBusiElineNnipw2List(ElementBusiElineNnipw2 elementBusiElineNnipw2)
    {
        return elementBusiElineNnipw2Mapper.selectElementBusiElineNnipw2List(elementBusiElineNnipw2);
    }

    /**
     * 新增网元-业务-eline-nni-pw高级属性
     * 
     * @param elementBusiElineNnipw2 网元-业务-eline-nni-pw高级属性
     * @return 结果
     */
    @Override
    public int insertElementBusiElineNnipw2(ElementBusiElineNnipw2 elementBusiElineNnipw2)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiElineNnipw2.getId())) {
            elementBusiElineNnipw2.setId(uuid);
        }
        elementBusiElineNnipw2.setCreateBy(SecurityUtils.getUsername());
        elementBusiElineNnipw2.setCreateTime(DateUtils.getNowDate());
        elementBusiElineNnipw2.setUpdateBy(SecurityUtils.getUsername());
        elementBusiElineNnipw2.setUpdateTime(DateUtils.getNowDate());
        return elementBusiElineNnipw2Mapper.insertElementBusiElineNnipw2(elementBusiElineNnipw2);
    }

    /**
     * 修改网元-业务-eline-nni-pw高级属性
     * 
     * @param elementBusiElineNnipw2 网元-业务-eline-nni-pw高级属性
     * @return 结果
     */
    @Override
    public int updateElementBusiElineNnipw2(ElementBusiElineNnipw2 elementBusiElineNnipw2)
    {
        elementBusiElineNnipw2.setUpdateBy(SecurityUtils.getUsername());
        elementBusiElineNnipw2.setUpdateTime(DateUtils.getNowDate());
        return elementBusiElineNnipw2Mapper.updateElementBusiElineNnipw2(elementBusiElineNnipw2);
    }

    /**
     * 批量删除网元-业务-eline-nni-pw高级属性
     * 
     * @param ids 需要删除的网元-业务-eline-nni-pw高级属性主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiElineNnipw2ByIds(String[] ids)
    {
        return elementBusiElineNnipw2Mapper.deleteElementBusiElineNnipw2ByIds(ids);
    }

    /**
     * 删除网元-业务-eline-nni-pw高级属性信息
     * 
     * @param id 网元-业务-eline-nni-pw高级属性主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiElineNnipw2ById(String id)
    {
        return elementBusiElineNnipw2Mapper.deleteElementBusiElineNnipw2ById(id);
    }
}
